import React, { Component } from 'react'

export default class comment extends Component {
    
    render() {
        var commentArr = this.props.commentList==null?'目前没有热评':this.props.commentList
        return (
            <div className="chatboard">
                <div><strong>热门留言/查看最新</strong></div>
                <div className="commentOne">
                    {/* <div className="chatP">
                        <div className="chatL">头像</div>
                        <div className="chatR">
                            <p>名字</p>
                            <p>内容撒旦发的啊手动阀家
                                里的房间啊啊手动阀手动
                                阀手动阀手动阀
                            </p>
                        </div>
                    </div>
                    <div className="chatP">
                        <div className="chatL">头像</div>
                        <div className="chatR">
                            <p>名字</p>
                            <p>内容</p>
                        </div>
                    </div> */}
                    {
                        commentArr.map((item,index)=>
                            <div className="chatP" key={item.commentId}>
                                <div className="chatL">
                                    <img src={item.user.avatarUrl} width="45px" height="45px" alt="#"/>
                                    头像
                                </div>
                                <div className="chatR">
                                    <strong>{item.user.nickname}</strong>
                                    <p>{item.content}</p>
                                </div>
                            </div>
                        )
                    }
                    <div className="chatP">
                        <div className="chatL">
                            <img width="45px" height="45px" alt=""/>
                            头像
                        </div>
                        <div className="chatR">
                            <strong>测试</strong>
                            <p>测试内容</p>
                        </div>
                    </div>
                </div>
            </div>
        )
    }
}
